﻿<Application x:Class="Prototypes.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:CustomControls="clr-namespace:CustomControls;assembly=CustomControls" StartupUri="MainWindow.xaml">
    <Application.Resources>

        <!---Brushes-->
        <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />
        <SolidColorBrush x:Key="SolidBorderBrush" Color="#0072C6" />
        <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF" />
        <SolidColorBrush x:Key="GlyphBrush" Color="#FFF" />
        <SolidColorBrush x:Key="NormalBrush" Color="#005DA2" />
        <SolidColorBrush x:Key="DisabledForegroundBrush" Color="white" />
        <Style x:Key="{x:Static MenuItem.SeparatorStyleKey}"
       TargetType="Separator">
            <Setter Property="Height" Value="1"/>
            <Setter Property="Margin" Value="0,4,0,4"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Separator">
                        <Border BorderBrush="{StaticResource SolidBorderBrush}"
                BorderThickness="1"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Custom MaskTextBox-->
        <DataTemplate x:Key="DefaultWatermarkTemplate">
            <ContentControl Content="{Binding}" Foreground="Gray" Focusable="False" />
        </DataTemplate>
        <Style TargetType="{x:Type CustomControls:MaskTextBox}">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="Background" Value="White" />
            <Setter Property="BorderBrush" Value="#BABABA" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="Padding" Value="3" />
            <Setter Property="AllowDrop" Value="true" />
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
            <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
            <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
            <Setter Property="WatermarkTemplate" Value="{StaticResource DefaultWatermarkTemplate}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type CustomControls:MaskTextBox}">
                        <Grid>

                            <Border x:Name="Border" BorderThickness="1" BorderBrush="#BABABA" CornerRadius="0" Background="White" />
                            <Border x:Name="MouseOverVisual" Opacity="0" BorderThickness="1" BorderBrush="#8F8F8F" CornerRadius="0" />
                            <Border x:Name="FocusVisual" Opacity="0" BorderThickness="1" BorderBrush="#5C5C5C" CornerRadius="0" />
                            <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            <ContentPresenter x:Name="PART_WatermarkHost"
                                    Content="{TemplateBinding Watermark}"
                                    ContentTemplate="{TemplateBinding WatermarkTemplate}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    IsHitTestVisible="False"
                                    Margin="{TemplateBinding Padding}"
                                    Visibility="Collapsed" />

                        </Grid>
                        <ControlTemplate.Triggers>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsFocused" Value="False" />
                                    <Condition Property="Text" Value="" />
                                </MultiTrigger.Conditions>
                                <MultiTrigger.Setters>
                                    <Setter Property="Visibility" TargetName="PART_WatermarkHost" Value="Visible" />
                                </MultiTrigger.Setters>
                            </MultiTrigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="MouseOverVisual" Property="Opacity" Value="1" />
                            </Trigger>
                            <Trigger Property="IsFocused" Value="True">
                                <Setter TargetName="FocusVisual" Property="Opacity" Value="1" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Border"  Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}" />
                                <Setter TargetName="Border"  Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
      
        <!-- Custom RadioButton -->
        <Style x:Key="RadioButtonFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border>
                            <Rectangle 
            Margin="15,0,0,0"
            StrokeThickness="1"
            Stroke="#60000000"
            StrokeDashArray="1 2"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="{x:Type RadioButton}" TargetType="{x:Type RadioButton}">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="FocusVisualStyle"    Value="{StaticResource RadioButtonFocusVisual}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RadioButton}">
                        <BulletDecorator Background="Transparent">
                            <BulletDecorator.Bullet>
                                <Grid Width="13" 
              Height="13" >
                                    <Ellipse x:Name="Border"  
                Fill="white"
                StrokeThickness="1"
                Stroke="#BABABA" />
                                    <Ellipse x:Name="CheckMark"
                Margin="4"
                Fill="#0072C6" />
                                </Grid>
                            </BulletDecorator.Bullet>
                            <ContentPresenter 
            Margin="4,0,0,0"
            VerticalAlignment="Center"
            HorizontalAlignment="Left"
            RecognizesAccessKey="True"/>
                        </BulletDecorator>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="false">
                                <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="Border" Property="Stroke" Value="#8F8F8F" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="Border" Property="Fill" Value="#0072C6" />
                                <Setter TargetName="Border" Property="Stroke" Value="#5C5C5C" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Border" Property="Fill" Value="{StaticResource DisabledBackgroundBrush}" />
                                <Setter TargetName="Border" Property="Stroke" Value="#40000000" />
                                <Setter Property="Foreground" Value="#80000000"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!--Custom ChekBox-->
        <Style x:Key="CheckBoxFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border>
                            <Rectangle 
            Margin="15,0,0,0"
            StrokeThickness="1"
            Stroke="#60000000"
            StrokeDashArray="1 2"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="{x:Type CheckBox}" TargetType="CheckBox">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="FocusVisualStyle"    Value="{StaticResource CheckBoxFocusVisual}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="CheckBox">
                        <BulletDecorator Background="Transparent">
                            <BulletDecorator.Bullet>
                                <Border x:Name="Border"  
              Width="13" 
              Height="13" 
              CornerRadius="0" 
              Background="white"
              BorderThickness="1"
              BorderBrush="#BABABA">
                                    <Path 
                Width="7" Height="7" 
                x:Name="CheckMark"
                SnapsToDevicePixels="False" 
                Stroke="#212121"
                StrokeThickness="2"
                Data="M 1 7 L 1 1 M 1 7 L 7 0" />
                                </Border>
                            </BulletDecorator.Bullet>
                            <ContentPresenter Margin="4,0,0,0"
            VerticalAlignment="Center"
            HorizontalAlignment="Left"
            RecognizesAccessKey="True"/>
                        </BulletDecorator>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="false">
                                <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="IsChecked" Value="{x:Null}">
                                <Setter TargetName="CheckMark" Property="Data" Value="M 0 7 L 7 0" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="Border" Property="BorderBrush" Value="#8F8F8F" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#212121" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="#212121" />
                                <Setter TargetName="CheckMark" Property="Stroke" Value="white" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Border" Property="Background" Value="gray" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}" />
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!--Custom TextBox-->
        <Style x:Key="{x:Type TextBox}" TargetType="{x:Type TextBoxBase}">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="MinWidth" Value="20"/>
            <Setter Property="MinHeight" Value="20"/>
            <Setter Property="AllowDrop" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TextBoxBase}">
                        <Border 
          Name="Border"
          CornerRadius="0" 
          Padding="2"
          Background="{StaticResource WindowBackgroundBrush}"
          BorderBrush="#BABABA"
          BorderThickness="1" >
                            <ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Border" Property="BorderBrush" Value="#8F8F8F"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="True">
                                <Setter TargetName="Border" Property="BorderBrush" Value="#5C5C5C"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!--Custom TextBox-->
        <!--<Style x:Key="{x:Type CustomControls:MaskTextBox}" TargetType="{x:Type TextBoxBase}">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="MinWidth" Value="20"/>
            <Setter Property="MinHeight" Value="20"/>
            <Setter Property="AllowDrop" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TextBoxBase}">
                        <Border 
          Name="Border"
          CornerRadius="0" 
          Padding="2"
          Background="{StaticResource WindowBackgroundBrush}"
          BorderBrush="#BABABA"
          BorderThickness="1" >
                            <ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Border" Property="BorderBrush" Value="#8F8F8F"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="True">
                                <Setter TargetName="Border" Property="BorderBrush" Value="#5C5C5C"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>-->

        <!--Custom button-->
        <Style x:Key="ButtonFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border>
                            <Rectangle 
            Margin="2"
            StrokeThickness="1"
            Stroke="#60000000"
            StrokeDashArray="1 2"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="Button">
            <Setter Property="Background" Value="#0072C6"/>
            <Setter Property="FontSize" Value="13" />
            <Setter Property="Foreground" Value="white" />
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontWeight" Value="ExtraLight"/>
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
            <Setter Property="MinHeight" Value="23"/>
            <Setter Property="MinWidth" Value="23"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border 
          x:Name="Border"  
          CornerRadius="0" 
          BorderThickness="0"
          Background="#0072C6"
          BorderBrush="#0072C6">
                            <ContentPresenter 
            Margin="2"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            RecognizesAccessKey="True"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsKeyboardFocused" Value="true">
                                <Setter TargetName="Border" Property="BorderBrush" Value="#0072C6" />
                            </Trigger>
                            <Trigger Property="IsDefaulted" Value="true">
                                <Setter TargetName="Border" Property="BorderBrush" Value="#0072C6" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#3D94D4" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="{StaticResource NormalBrush}" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource NormalBrush}" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Border" Property="Background" Value="gray" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="gray" />
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <!-- TopLevelHeader -->
        <ControlTemplate x:Key="{x:Static MenuItem.TopLevelHeaderTemplateKey}"
                 TargetType="MenuItem">
            <Border Name="Border" >
                <Grid>
                    <ContentPresenter 
        Margin="6,3,6,3" 
        ContentSource="Header"
        RecognizesAccessKey="True" />
                    <Popup 
        Name="Popup"
        Placement="Bottom"
        IsOpen="{TemplateBinding IsSubmenuOpen}"
        AllowsTransparency="False" 
        Focusable="False"
        PopupAnimation="Fade">
                        <Border 
          Name="SubmenuBorder"
          SnapsToDevicePixels="True"
          Background="{StaticResource SolidBorderBrush}"
          BorderBrush="{StaticResource SolidBorderBrush}"
          BorderThickness="1" >
                            <StackPanel  
            IsItemsHost="True" 
            KeyboardNavigation.DirectionalNavigation="Cycle" />
                        </Border>
                    </Popup>
                </Grid>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsSuspendingPopupAnimation" Value="true">
                    <Setter TargetName="Popup" Property="PopupAnimation" Value="None"/>
                </Trigger>
                <Trigger Property="IsHighlighted" Value="true">
                    <Setter TargetName="Border" Property="Background"
              Value="{StaticResource NormalBrush}"/>
                    <Setter Property="Foreground"
                            Value="white" />
                    <Setter TargetName="Border" Property="BorderBrush"
              Value="#0072C6"/>
                </Trigger>
                <Trigger Property="IsHighlighted" Value="False">
                    <Setter TargetName="Border" Property="Background"
              Value="#0072C6" />
                    <Setter Property="Foreground"  Value="white"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Foreground" Value="#667777"/>
                    <Setter TargetName="Border" Property="Background" Value="#D4D4D4"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="true">
                    <Setter TargetName="Border" Property="Background"
                            Value="#00508C"></Setter>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        <!-- TopLevelItem -->

        <ControlTemplate 
  x:Key="{x:Static MenuItem.TopLevelItemTemplateKey}" 
  TargetType="MenuItem">
            <Border Name="Border" >
                <Grid>
                    <ContentPresenter 
        Margin="6,3,6,3" 
        ContentSource="Header"
        RecognizesAccessKey="True" />
                </Grid>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsHighlighted" Value="true">
                    <Setter TargetName="Border" Property="Background"
              Value="{StaticResource NormalBrush}"/>
                    <Setter Property="Foreground" Value="white" />
                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource SolidBorderBrush}"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Foreground" Value="#667777"/>
                    <Setter TargetName="Border" Property="Background" Value="#D4D4D4"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="true">
                    <Setter TargetName="Border" Property="Background"
                            Value="#00508C"></Setter>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <!-- SubmenuItem -->

        <ControlTemplate 
  x:Key="{x:Static MenuItem.SubmenuItemTemplateKey}" 
  TargetType="MenuItem">
            <Border Name="Border" Background="#0072C6">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" SharedSizeGroup="Icon"/>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" SharedSizeGroup="Shortcut"/>
                        <ColumnDefinition Width="13"/>
                    </Grid.ColumnDefinitions>
                    <ContentPresenter 
        Name="Icon"
        Margin="6,0,6,0"
        VerticalAlignment="Center"
        HorizontalAlignment="Center"
        ContentSource="Icon"/>
                    <Border 
        Name="Check"  
        Width="13" Height="13" 
        Visibility="Collapsed"
        Margin="6,0,6,0" 
        Background="{StaticResource NormalBrush}"
        BorderThickness="1"
        BorderBrush="#0072C6">
                        <Path 
          Name="CheckMark"
          Width="7" Height="7" 
          Visibility="Hidden" 
          SnapsToDevicePixels="False" 
          Stroke="White"
          StrokeThickness="2"
          Data="M 0 0 L 7 7 M 0 7 L 7 0" />
                    </Border>
                    <ContentPresenter 
        Name="HeaderHost"
        Grid.Column="1"
        ContentSource="Header"
        RecognizesAccessKey="True"/>
                    <TextBlock x:Name="InputGestureText"
        Grid.Column="2"
     Text="{TemplateBinding InputGestureText}"        
        Margin="5,2,0,2"
        DockPanel.Dock="Right" />
                </Grid>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="Icon" Value="{x:Null}">
                    <Setter TargetName="Icon" Property="Visibility" Value="Hidden"/>
                </Trigger>
                <Trigger Property="IsChecked" Value="true">
                    <Setter TargetName="CheckMark" Property="Visibility" Value="Visible"/>
                </Trigger>
                <Trigger Property="IsCheckable" Value="true">
                    <Setter TargetName="Check" Property="Visibility" Value="Visible"/>
                    <Setter TargetName="Icon" Property="Visibility" Value="Hidden"/>
                </Trigger>
                <Trigger Property="IsHighlighted" Value="true">
                    <Setter TargetName="Border" Property="Background"
              Value="#005DA2"/>
                    <Setter Property="Foreground"  Value="white"/>
                </Trigger>
                <Trigger Property="IsHighlighted" Value="False">
                    <Setter TargetName="Border" Property="Background"
              Value="#0072C6" />
                    <Setter Property="Foreground"  Value="white"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Foreground" Value="#667777"/>
                    <Setter TargetName="Border" Property="Background" Value="#D4D4D4"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="true">
                    <Setter TargetName="Border" Property="Background"
                            Value="#00508C"></Setter>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <!-- SubmenuHeader -->

        <ControlTemplate 
  x:Key="{x:Static MenuItem.SubmenuHeaderTemplateKey}" 
  TargetType="MenuItem">
            <Border Name="Border" >
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" SharedSizeGroup="Icon"/>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" SharedSizeGroup="Shortcut"/>
                        <ColumnDefinition Width="13"/>
                    </Grid.ColumnDefinitions>
                    <ContentPresenter 
        Name="Icon"
        Margin="6,0,6,0"
        VerticalAlignment="Center"
        ContentSource="Icon"/>
                    <ContentPresenter 
        Name="HeaderHost"
        Grid.Column="1"
        ContentSource="Header"
        RecognizesAccessKey="True"/>
                    <TextBlock x:Name="InputGestureText"
        Grid.Column="2"
                      Background="#00508C"
                   Foreground="White"
        Text="{TemplateBinding InputGestureText}"
        Margin="5,2,2,2"
        DockPanel.Dock="Right"/>
                    <Path 
        Grid.Column="3"
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Data="M 0 0 L 0 7 L 4 3.5 Z" 
        Fill="white" />
                    <Popup 
        Name="Popup"
        Placement="Right"
        HorizontalOffset="-4" 
        IsOpen="{TemplateBinding IsSubmenuOpen}"
        AllowsTransparency="False" 
        Focusable="False"
        PopupAnimation="Fade">
                        <Border 
          Name="SubmenuBorder"
          SnapsToDevicePixels="True"
          Background="#0072C6"
          BorderBrush="white"
          BorderThickness="1" >
                            <StackPanel  
            IsItemsHost="True" 
            KeyboardNavigation.DirectionalNavigation="Cycle" />
                        </Border>
                    </Popup>
                </Grid>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="Icon" Value="{x:Null}">
                    <Setter TargetName="Icon" Property="Visibility" Value="Collapsed"/>
                </Trigger>
                <Trigger Property="IsHighlighted" Value="true">
                    <Setter TargetName="Border" Property="Background"
              Value="{StaticResource NormalBrush}"/>
                    <Setter Property="Foreground" Value="white" />
                </Trigger>
                <Trigger Property="IsHighlighted" Value="false">
                    <Setter TargetName="Border" Property="Background"
              Value="#0072C6"/>
                    <Setter Property="Foreground" Value="white" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Foreground" Value="#667777"/>
                    <Setter TargetName="Border" Property="Background" Value="#D4D4D4"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="true">
                    <Setter TargetName="Border" Property="Background"
                            Value="#00508C"></Setter>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <!-- MenuItem Style -->

        <Style x:Key="{x:Type MenuItem}" TargetType="MenuItem">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontWeight" Value="ExtraLight"/>
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Style.Triggers>
                <Trigger Property="Role" Value="TopLevelHeader">
                    <Setter Property="Template"
              Value="{StaticResource {x:Static MenuItem.TopLevelHeaderTemplateKey}}"/>
                    <Setter Property="Grid.IsSharedSizeScope" Value="true"/>
                </Trigger>
                <Trigger Property="Role" Value="TopLevelItem">
                    <Setter Property="Template"
              Value="{StaticResource {x:Static MenuItem.TopLevelItemTemplateKey}}"/>
                </Trigger>
                <Trigger Property="Role" Value="SubmenuHeader">
                    <Setter Property="Template"
              Value="{StaticResource {x:Static MenuItem.SubmenuHeaderTemplateKey}}"/>
                </Trigger>
                <Trigger Property="Role" Value="SubmenuItem">
                    <Setter Property="Template"
              Value="{StaticResource {x:Static MenuItem.SubmenuItemTemplateKey}}"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="true">
                    <Setter Property="Background"
                            Value="#00508C"></Setter>
                </Trigger>
            </Style.Triggers>
        </Style> 
        
        <!--Custom ScrollBar-->
        <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Border 
          Name="Border"
          Margin="0,1,0,1" 
          CornerRadius="0" 
          Background="#F0F0F0"
          BorderBrush="#F0F0F0"
          BorderThickness="1">
                            <Path Name="Path"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Fill="#606060"
            Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}" >
                            </Path>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#CDCDCD" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="#CDCDCD" />
                                <Setter TargetName="Path" Property="Fill" Value="black" />
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#606060" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="#606060" />
                                <Setter TargetName="Path" Property="Fill" Value="white" />
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Border Background="Transparent" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Border Name="Border"
          CornerRadius="0" 
          Background="{TemplateBinding Background}"
          BorderBrush="{TemplateBinding BorderBrush}"
          BorderThickness="1" />
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#DADADA" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="#DADADA" />
                            </Trigger>
                            <Trigger Property="IsDragging" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#606060" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="#606060" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
            <Grid >
                <Grid.RowDefinitions>
                    <RowDefinition MaxHeight="18"/>
                    <RowDefinition Height="0.00001*"/>
                    <RowDefinition MaxHeight="18"/>
                </Grid.RowDefinitions>
                <Border
      Grid.RowSpan="3"
      CornerRadius="0" 
      Background="#F0F0F0" />
                <RepeatButton 
      Grid.Row="0"                           
      Style="{StaticResource ScrollBarLineButton}"
      Height="18"
      Command="ScrollBar.LineUpCommand"
      Content="M 0 4 L 8 4 L 4 0 Z" />
                <Track 
      Name="PART_Track"
      Grid.Row="1"
      IsDirectionReversed="true">
                    <Track.DecreaseRepeatButton>
                        <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageUpCommand" />
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                        <Thumb 
          Style="{StaticResource ScrollBarThumb}" 
          Margin="1,0,1,0"  
          Background="#CDCDCD"
          BorderBrush="#CDCDCD" />
                    </Track.Thumb>
                    <Track.IncreaseRepeatButton>
                        <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageDownCommand" />
                    </Track.IncreaseRepeatButton>
                </Track>
                <RepeatButton 
      Grid.Row="3" 
      Style="{StaticResource ScrollBarLineButton}"
      Height="18"
      Command="ScrollBar.LineDownCommand"
      Content="M 0 0 L 4 4 L 8 0 Z"/>
            </Grid>
        </ControlTemplate>

        <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
            <Grid >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition MaxWidth="18"/>
                    <ColumnDefinition Width="0.00001*"/>
                    <ColumnDefinition MaxWidth="18"/>
                </Grid.ColumnDefinitions>
                <Border
      Grid.ColumnSpan="3"
      CornerRadius="0" 
      Background="#F0F0F0" />
                <RepeatButton 
      Grid.Column="0"                           
      Style="{StaticResource ScrollBarLineButton}"
      Width="18"
      Command="ScrollBar.LineLeftCommand"
      Content="M 4 0 L 4 8 L 0 4 Z" />
                <Track 
      Name="PART_Track"
      Grid.Column="1"
      IsDirectionReversed="False">
                    <Track.DecreaseRepeatButton>
                        <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageLeftCommand" />
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                        <Thumb 
          Style="{StaticResource ScrollBarThumb}" 
          Margin="0,1,0,1"  
          Background="#CDCDCD"
          BorderBrush="#CDCDCD" />
                    </Track.Thumb>
                    <Track.IncreaseRepeatButton>
                        <RepeatButton 
          Style="{StaticResource ScrollBarPageButton}"
          Command="ScrollBar.PageRightCommand" />
                    </Track.IncreaseRepeatButton>
                </Track>
                <RepeatButton 
      Grid.Column="3" 
      Style="{StaticResource ScrollBarLineButton}"
      Width="18"
      Command="ScrollBar.LineRightCommand"
      Content="M 0 0 L 4 4 L 0 8 Z"/>
            </Grid>
        </ControlTemplate>

        <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Style.Triggers>
                <Trigger Property="Orientation" Value="Horizontal">
                    <Setter Property="Width" Value="Auto"/>
                    <Setter Property="Height" Value="18" />
                    <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
                </Trigger>
                <Trigger Property="Orientation" Value="Vertical">
                    <Setter Property="Width" Value="18"/>
                    <Setter Property="Height" Value="Auto" />
                    <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
                </Trigger>
            </Style.Triggers>
        </Style>
        
        <!-- Custom Combobox item -->
        <Style x:Key="{x:Type ComboBoxItem}" TargetType="ComboBoxItem">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBoxItem">
                        <Border 
          Name="Border"
          Padding="4"
          SnapsToDevicePixels="true">
                            <ContentPresenter />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsHighlighted" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#F3F3F3"/>
                                <Setter Property="Foreground" Value="Black"/>
                            </Trigger>
                            <Trigger Property="IsSelected" Value="true">
                                <Setter TargetName="Border" Property="Background" Value="#0072C6"/>
                                <Setter Property="Foreground" Value="white"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Custom Combobox -->

        <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="ToggleButton">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="20" />
                </Grid.ColumnDefinitions>
                <Border
      x:Name="Border" 
      Grid.ColumnSpan="2"
      CornerRadius="0"
      Background="#BABABA"
      BorderBrush="#BABABA"
      BorderThickness="1" />
                <Border Name="Separator"
      Grid.Column="0"
      CornerRadius="0,0,0,0" 
      Margin="1" 
      Background="{StaticResource WindowBackgroundBrush}" 
      BorderBrush="#BABABA"
      BorderThickness="0,0,1,0" />
                <Path 
      x:Name="Arrow"
      Grid.Column="1"     
      Fill="{StaticResource GlyphBrush}"
      HorizontalAlignment="Center"
      VerticalAlignment="Center"
      Data="M 0 0 L 4 4 L 8 0 Z"/>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="ToggleButton.IsMouseOver" Value="true">
                    <Setter TargetName="Border" Property="Background" Value="#8F8F8F" />
                    <Setter TargetName="Border" Property="BorderBrush" Value="#8F8F8F" />
                    <Setter TargetName="Separator" Property="BorderBrush" Value="#8F8F8F" />
                </Trigger>
                <Trigger Property="ToggleButton.IsChecked" Value="true">
                    <Setter TargetName="Border" Property="Background" Value="#5C5C5C" />
                    <Setter TargetName="Border" Property="BorderBrush" Value="#5C5C5C" />
                    <Setter TargetName="Separator" Property="BorderBrush" Value="#5C5C5C" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}" />
                    <Setter TargetName="Separator" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}" />
                    <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                    <Setter TargetName="Arrow" Property="Fill" Value="{StaticResource DisabledForegroundBrush}" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <ControlTemplate x:Key="ComboBoxTextBox" TargetType="TextBox">
            <Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}" />
        </ControlTemplate>

        <Style x:Key="{x:Type ComboBox}" TargetType="ComboBox">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
            <Setter Property="MinWidth" Value="20"/>
            <Setter Property="MinHeight" Value="20"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBox">
                        <Grid>
                            <ToggleButton 
            Name="ToggleButton" 
            Template="{StaticResource ComboBoxToggleButton}" 
            Grid.Column="2" 
            Focusable="false"
            IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
            ClickMode="Press">
                            </ToggleButton>
                            <ContentPresenter
            Name="ContentSite"
            IsHitTestVisible="False" 
            Content="{TemplateBinding SelectionBoxItem}"
            ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
            ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
            Margin="3,3,23,3"
            VerticalAlignment="Center"
            HorizontalAlignment="Left" />
                            <TextBox x:Name="PART_EditableTextBox"
            Style="{x:Null}" 
            Template="{StaticResource ComboBoxTextBox}" 
            HorizontalAlignment="Left" 
            VerticalAlignment="Center" 
            Margin="3,3,23,3"
            Focusable="True" 
            Background="Transparent"
            Visibility="Hidden"
            IsReadOnly="{TemplateBinding IsReadOnly}"/>
                            <Popup 
            Name="Popup"
            Placement="Bottom"
            IsOpen="{TemplateBinding IsDropDownOpen}"
            AllowsTransparency="True" 
            Focusable="False"
            PopupAnimation="Slide">
                                <Grid 
              Name="DropDown"
              SnapsToDevicePixels="True"                
              MinWidth="{TemplateBinding ActualWidth}"
              MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                    <Border 
                x:Name="DropDownBorder"
                Background="{StaticResource WindowBackgroundBrush}"
                BorderThickness="1"
                BorderBrush="#5C5C5C"/>
                                    <ScrollViewer Margin="1,0,1,1" SnapsToDevicePixels="True">
                                        <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                                    </ScrollViewer>
                                </Grid>
                            </Popup>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="HasItems" Value="false">
                                <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                            <Trigger Property="IsGrouping" Value="true">
                                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                            </Trigger>
                            <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
                                <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="0"/>
                                <Setter TargetName="DropDownBorder" Property="Margin" Value="0,-1,0,0"/>
                            </Trigger>
                            <Trigger Property="IsEditable"
               Value="true">
                                <Setter Property="IsTabStop" Value="false"/>
                                <Setter TargetName="PART_EditableTextBox" Property="Visibility"    Value="Visible"/>
                                <Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
            </Style.Triggers>
        </Style>
    
        <!-- Custom Label -->
        <Style x:Key="{x:Type Label}" TargetType="Label">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Top"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Label">
                        <Border>
                            <ContentPresenter 
            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
            RecognizesAccessKey="True"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground"
                    Value="{StaticResource DisabledForegroundBrush}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <!-- Custom Groupbox -->

        <Style TargetType="GroupBox">
            <Setter Property="FontFamily" Value="Segoe UI"></Setter>
                <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="GroupBox">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Border 
            Grid.Row="0" 
            Background="white"
            BorderBrush="#BABABA"
            BorderThickness="1" 
            CornerRadius="0,0,0,0" >
                                <ContentPresenter 
              Margin="4" 
              ContentSource="Header" 
              RecognizesAccessKey="True" />
                            </Border>
                            <Border 
            Grid.Row="1"
            Background="{StaticResource WindowBackgroundBrush}"
            BorderBrush="#BABABA"
            BorderThickness="1,0,1,1" 
            CornerRadius="0,0,0,0" >
                                <ContentPresenter 
              Margin="4" />
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" FontSize="18" FontWeight="Light"/>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <!-- Custom scrollviewer -->
        <Style x:Key="RightScrollViewer" TargetType="{x:Type ScrollViewer}">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ScrollViewer}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <ScrollContentPresenter Grid.Column="2"/>

                            <ScrollBar Name="PART_VerticalScrollBar"
            Value="{TemplateBinding VerticalOffset}"
            Maximum="{TemplateBinding ScrollableHeight}"
            ViewportSize="{TemplateBinding ViewportHeight}"
            Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
                            <ScrollBar Name="PART_HorizontalScrollBar"
            Orientation="Horizontal"
            Grid.Row="1"
            Grid.Column="1"
            Value="{TemplateBinding HorizontalOffset}"
            Maximum="{TemplateBinding ScrollableWidth}"
            ViewportSize="{TemplateBinding ViewportWidth}"
            Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>

                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <!-- Custom ListView and ListViewItems -->

        <DataTemplate x:Key="InformerItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#6FBDE8">
                <Grid Height="80">
                <TextBlock Margin="10,0,0,0" Text="{Binding Informer}" VerticalAlignment="Center"  ToolTip="Nombre del Denunciante"/>
                    <TextBlock FontSize="10" Margin="10,0,0,10" Text="{Binding Path=InformerCi, StringFormat='Ci: {0}'}" VerticalAlignment="Bottom" ToolTip="Ci del Denunciante" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="DetailsItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#6FBDE8">
                <Grid Height="80">
                    <TextBlock Width="140" TextWrapping="Wrap" Margin="10,0,0,0" Text="{Binding AggressionType}" VerticalAlignment="Center"  ToolTip="Tipo de agresion"/>
                    <TextBlock FontSize="10" Margin="10,0,0,10" Text="{Binding Path=CaseNum, StringFormat='Numero de Caso: {0}'}"  VerticalAlignment="Bottom" ToolTip="Número de caso" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="VictimItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#6FBDE8">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Image Source="Images/NoImage.jpg" Width="80" Height="80" Grid.Column="0" HorizontalAlignment="Center" />
                    <TextBlock Margin="10,0,0,0" Text="{Binding Victim}" VerticalAlignment="Center" Grid.Column="1" ToolTip="Nombre de la Victima" />
                    <TextBlock FontSize="10" Margin="10,0,0,10" Text="{Binding Path=VictimCi, StringFormat='Ci: {0}'}" VerticalAlignment="Bottom" Grid.Column="1" ToolTip="Ci de la Victima" />
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="AggressorItemTemplate">
            <Border BorderThickness="0,0,0,0" BorderBrush="#6FBDE8">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="80" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Image Source="Images/NoImage.jpg" Width="80" Height="80" Grid.Column="0" HorizontalAlignment="Center" />
                    <TextBlock Margin="10,0,0,0" Text="{Binding Aggressor}" VerticalAlignment="Center" Grid.Column="1" ToolTip="Nombre completo"/>
                    <TextBlock FontSize="10" Margin="10,0,0,10" Text="{Binding Path=AggressorCi, StringFormat='Ci: {0}'}" VerticalAlignment="Bottom" Grid.Column="1" ToolTip="Ci del Agresor" />
                </Grid>
            </Border>
        </DataTemplate>

        <Style x:Key="ListViewItemContainerStyle" TargetType="{x:Type ListViewItem}">
            <Setter Property="Background" Value="#ffffff" />
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontWeight" Value="Light"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="HorizontalContentAlignment" Value="Left" />
            <Setter Property="Height" Value="100"/>
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="Foreground" Value="Black" />
            <Setter Property="Margin" Value="0,0,0,0" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListViewItem}">
                        <Border x:Name="Bd" Background="{TemplateBinding Background}" SnapsToDevicePixels="true" BorderThickness="0,0,0,1" BorderBrush="#BABABA">
                            <GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsSelected"  Value="true">
                                <Setter TargetName="Bd" Property="BorderBrush" Value="#5C5C5C" />
                                <Setter Property="Background" TargetName="Bd" Value="#0072C6"/>
                                <Setter Property="Foreground" Value="White"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Bd" Property="Background" Value="#F3F3F3" />
                                <Setter TargetName="Bd" Property="BorderBrush" Value="#8F8F8F"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true" />
                                    <Condition Property="Selector.IsSelectionActive" Value="True" />
                                </MultiTrigger.Conditions>
                                <Setter Property="Background" TargetName="Bd" Value="#0072C6">
                                </Setter>
                                <Setter Property="BorderBrush" TargetName="Bd" Value="#5C5C5C"/>
                                <Setter Property="Foreground" Value="White"/>
                            </MultiTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <LinearGradientBrush x:Key="BackgroundBrush" StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="#FF6FBDE8" Offset="0"/>
                    <GradientStop Color="#FF4385BE" Offset="1"/>
                </GradientStopCollection>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="HighlightBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="#FF97d3f3" Offset="0"/>
                    <GradientStop Color="#FF4385BE" Offset="1"/>
                </GradientStopCollection>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="BorderBrush" StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="#FFAFDDF6" Offset="0"/>
                    <GradientStop Color="#FF2969AA" Offset="1"/>
                </GradientStopCollection>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="#FF75aac7" Offset="0"/>
                    <GradientStop Color="#0072C6" Offset="1"/>
                </GradientStopCollection>
            </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>

        <Style x:Key="GridViewColumnHeaderGripper" TargetType="Thumb">
            <Setter Property="Width" Value="14"/>
            <Setter Property="Background" Value="BLACK"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Border Padding="{TemplateBinding Padding}" Background="Transparent">
                            <Rectangle HorizontalAlignment="Center" Width="1" Fill="{TemplateBinding Background}"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="{x:Type GridViewColumnHeader}" TargetType="GridViewColumnHeader">
            <Setter Property="FontFamily" Value="Segoe UI"></Setter>
            <Setter Property="FontWeight" Value="Light"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Foreground" Value="#FFFFFF" />
            <Setter Property="Padding" Value="8"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="GridViewColumnHeader">
                        <Grid>
                            <Border Name="HeaderBorder" Padding="{TemplateBinding Padding}" BorderThickness="0,0,0,0" BorderBrush="{StaticResource BorderBrush}" Background="{StaticResource BackgroundBrush}">
                                <ContentPresenter Name="HeaderContent" Margin="0,0,0,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </Border>
                            <Thumb x:Name="PART_HeaderGripper" HorizontalAlignment="Right" Margin="0,0,-8,0" Style="{StaticResource GridViewColumnHeaderGripper}"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter TargetName="HeaderBorder" Property="Background" Value="{StaticResource HighlightBackgroundBrush}"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter TargetName="HeaderBorder" Property="Background" Value="{StaticResource PressedBorderBrush}"/>
                                <Setter TargetName="HeaderContent" Property="Margin" Value="0,0,0,0"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="Role" Value="Floating">
                    <Setter Property="Opacity" Value="0.7"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="GridViewColumnHeader">
                                <Canvas Name="PART_FloatingHeaderCanvas">
                                    <Rectangle Fill="#60000000" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"/>
                                </Canvas>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Trigger>
                <Trigger Property="Role" Value="Padding">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="GridViewColumnHeader">
                                <Border Name="HeaderBorder" BorderThickness="0,0,0,0" BorderBrush="{StaticResource BorderBrush}" Background="{StaticResource BackgroundBrush}"/>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="{x:Static GridView.GridViewScrollViewerStyleKey}" TargetType="ScrollViewer">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ScrollViewer">
                        <Grid Background="{TemplateBinding Background}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <DockPanel Margin="{TemplateBinding Padding}">
                                <ScrollViewer DockPanel.Dock="Top" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Focusable="false">
                                    <GridViewHeaderRowPresenter Margin="0,0,0,0" Columns="{Binding Path=TemplatedParent.View.Columns,
                                            RelativeSource={RelativeSource TemplatedParent}}" ColumnHeaderContainerStyle="{Binding Path=TemplatedParent.View.ColumnHeaderContainerStyle, RelativeSource={RelativeSource TemplatedParent}}" 
                                            ColumnHeaderTemplate="{Binding Path=TemplatedParent.View.ColumnHeaderTemplate,RelativeSource={RelativeSource TemplatedParent}}" 
                                            ColumnHeaderTemplateSelector="{Binding Path=TemplatedParent.View.ColumnHeaderTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}" 
                                            AllowsColumnReorder="{Binding Path=TemplatedParent.View.AllowsColumnReorder, RelativeSource={RelativeSource TemplatedParent}}"
                                            ColumnHeaderContextMenu="{Binding Path=TemplatedParent.View.ColumnHeaderContextMenu, RelativeSource={RelativeSource TemplatedParent}}" 
                                            ColumnHeaderToolTip="{Binding Path=TemplatedParent.View.ColumnHeaderToolTip, RelativeSource={RelativeSource TemplatedParent}}" 
                                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                </ScrollViewer>
                                <ScrollContentPresenter Name="PART_ScrollContentPresenter"
                                            KeyboardNavigation.DirectionalNavigation="Local"
                                            CanContentScroll="True" CanHorizontallyScroll="False" 
                                            CanVerticallyScroll="False"/>
                            </DockPanel>
                            <ScrollBar Name="PART_HorizontalScrollBar" Orientation="Horizontal" Grid.Row="1" Maximum="{TemplateBinding ScrollableWidth}" ViewportSize="{TemplateBinding ViewportWidth}" Value="{TemplateBinding HorizontalOffset}" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
                            <ScrollBar Name="PART_VerticalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" ViewportSize="{TemplateBinding ViewportHeight}" Value="{TemplateBinding VerticalOffset}" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="{x:Type ListView}" TargetType="ListView">
            <Setter Property="SnapsToDevicePixels" Value="true"/>
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListView">
                        <Border Name="Border" BorderThickness="1" BorderBrush="#BABABA" Background="White">
                            <ScrollViewer Style="{DynamicResource {x:Static GridView.GridViewScrollViewerStyleKey}}">
                                <ItemsPresenter />
                            </ScrollViewer>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsGrouping" Value="true">
                                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Border" Property="Background" Value="#BBBBBB"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>
</Application>
